package design_pattern.proxy_pattern.static_proxy;

/**
 * @author Cheng Jun Description: 房屋中介类
 * @version 1.0
 * @date 2022/7/20 17:27
 */
public class HouseAgency implements LandLord {
    private LandLord landLord;

    public  HouseAgency (LandLord landLord){
      this.landLord= landLord;
    }
    /**
     * @param rentMoney 租金
     * @return java.lang.String 返回 success，表示出租成功
     * @author Cheng Jun
     * @date 2022/7/20 17:11
     */
    @Override
    public String rentHouse(int rentMoney) {
        //代理类，可以增强功能
        collectInfo();
        return landLord.rentHouse(rentMoney);
    }

    private void collectInfo() {
        System.out.println("房屋中介在租房前，收集租房人的信息");
    }
}
